dynamic class com.darronschall.DynamicRegistration
{
    var _parent;
    var _rotation;
    var _x;
    var _xmouse;
    var _xscale;
    var _y;
    var _ymouse;
    var _yscale;
    var localToGlobal;
    var xreg;
    var yreg;

    function DynamicRegistration()
    {
    }

    static function initialize(target_mc)
    {
        var p = _global.com.darronschall.DynamicRegistration.prototype;
        target_mc.xreg = 0;
        target_mc.yreg = 0;
        target_mc.setRegistration = p.setRegistration;
        target_mc.setPropRel = p.setPropRel;
        with (target_mc)
        {
            addProperty("_x2", p.get_x2, p.set_x2);
            addProperty("_y2", p.get_y2, p.set_y2);
            addProperty("_xscale2", p.get_xscale2, p.set_xscale2);
            addProperty("_yscale2", p.get_yscale2, p.set_yscale2);
            addProperty("_rotation2", p.get_rotation2, p.set_rotation2);
            addProperty("_xmouse2", p.get_xmouse2, null);
            addProperty("_ymouse2", p.get_ymouse2, null);
        }
    }

    function setRegistration(x, y)
    {
        this.xreg = x;
        this.yreg = y;
    }

    function get_x2()
    {
        var __reg2 = {x: this.xreg, y: this.yreg};
        this.localToGlobal(__reg2);
        this._parent.globalToLocal(__reg2);
        return __reg2.x;
    }

    function set_x2(value)
    {
        var __reg2 = {x: this.xreg, y: this.yreg};
        this.localToGlobal(__reg2);
        this._parent.globalToLocal(__reg2);
        this._x = this._x + (value - __reg2.x);
    }

    function get_y2()
    {
        var __reg2 = {x: this.xreg, y: this.yreg};
        this.localToGlobal(__reg2);
        this._parent.globalToLocal(__reg2);
        return __reg2.y;
    }

    function set_y2(value)
    {
        var __reg2 = {x: this.xreg, y: this.yreg};
        this.localToGlobal(__reg2);
        this._parent.globalToLocal(__reg2);
        this._y = this._y + (value - __reg2.y);
    }

    function set_xscale2(value)
    {
        this.setPropRel("_xscale", value);
    }

    function get_xscale2()
    {
        return this._xscale;
    }

    function set_yscale2(value)
    {
        this.setPropRel("_yscale", value);
    }

    function get_yscale2()
    {
        return this._yscale;
    }

    function set_rotation2(value)
    {
        this.setPropRel("_rotation", value);
    }

    function get_rotation2()
    {
        return this._rotation;
    }

    function get_xmouse2()
    {
        return this._xmouse - this.xreg;
    }

    function get_ymouse2()
    {
        return this._ymouse - this.yreg;
    }

    function setPropRel(property, amount)
    {
        var __reg3 = {x: this.xreg, y: this.yreg};
        this.localToGlobal(__reg3);
        this._parent.globalToLocal(__reg3);
        this[property] = amount;
        var __reg2 = {x: this.xreg, y: this.yreg};
        this.localToGlobal(__reg2);
        this._parent.globalToLocal(__reg2);
        this._x = this._x - (__reg2.x - __reg3.x);
        this._y = this._y - (__reg2.y - __reg3.y);
    }

}
